Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Add count of one time keys to sync stream #2237

Merged
merged 5 commits into from
May 23, 2017
Merged

Conversation

erikjohnston
Copy link
Member

This adds the following to a sync result:

{
    "device_one_time_keys_count": {
        "signed_curve25519": 50
    },
    ...
}

Copy link
Member

@richvdh richvdh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks ok, but count_e2e_one_time_keys has a cache, and I'm unconvinced it will be correctly invalidated in the synchotrons when a key is claimed in the main process.

@richvdh richvdh assigned erikjohnston and unassigned richvdh May 22, 2017
@erikjohnston
Copy link
Member Author

looks ok, but count_e2e_one_time_keys has a cache, and I'm unconvinced it will be correctly invalidated in the synchotrons when a key is claimed in the main process.

Oops, yeah. It now streams the invalidations to workers.

@erikjohnston erikjohnston assigned richvdh and unassigned erikjohnston May 22, 2017
@erikjohnston
Copy link
Member Author

(The sqlite failure is spurious as it built on a box that didn't have tox installed)

Copy link
Member

@richvdh richvdh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you missed one of the calls:

self.count_e2e_one_time_keys.invalidate, (user_id, device_id,)

LGTM otherwise

@richvdh richvdh assigned erikjohnston and unassigned richvdh May 22, 2017
@erikjohnston
Copy link
Member Author

But i used grep and everything! :(

@@ -240,6 +240,9 @@ def _claim_e2e_one_time_keys(txn):
txn.call_after(
self.count_e2e_one_time_keys.invalidate, (user_id, device_id,)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

now redundant?

@richvdh
Copy link
Member

richvdh commented May 23, 2017

But i used grep and everything! :(

Apparently you fail at grep.

@richvdh richvdh closed this May 23, 2017
@richvdh richvdh reopened this May 23, 2017
@erikjohnston
Copy link
Member Author

Apparently you fail at grep.

And editing code too. Sigh. applies more coffee

Copy link
Member

@richvdh richvdh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@erikjohnston erikjohnston merged commit fbbc40f into develop May 23, 2017
richvdh pushed a commit to matrix-org/matrix-js-sdk that referenced this pull request Jul 19, 2017
Where it is available, use the one_time_keys_count returned by /sync instead of polling the server for it.

This was added to synapse in matrix-org/synapse#2237.
@erikjohnston erikjohnston deleted the erikj/sync_key_count branch October 26, 2017 11:00
@bmarty
Copy link

bmarty commented Dec 4, 2019

(FTR element-hq/element-android#737)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants